package sqlop

import (
	"likeadmin/clog"
	dbc "likeadmin/dbc"
)

func ExecOneP(sql string, valueOne interface{}) error {
	var db = dbc.DB.Exec(sql, valueOne)
	//if db.RowsAffected > 0 {
	clog.Print("sqlop,ExecOneP,sql=", sql)
	clog.Info("sqlop,ExecOneP,valueOne=", valueOne)
	clog.Info("sqlop,ExecOneP,db.RowsAffected=", db.RowsAffected)
	//}
	return db.Error
}

func ExecTwoP(sql string, valueOne interface{}, valueTwo interface{}) error {
	var db = dbc.DB.Exec(sql, valueOne, valueTwo)
	//if db.RowsAffected > 0 {
	clog.Print("sqlop,ExecTwoP,sql=", sql)
	clog.Info("sqlop,ExecTwoP,valueOne=", valueOne)
	clog.Info("sqlop,ExecTwoP,valueTwo=", valueTwo)
	clog.Info("sqlop,ExecTwoP,db.RowsAffected=", db.RowsAffected)
	//}
	return db.Error
}

func ExecThreeP(sql string, valueOne interface{}, valueTwo interface{}, valueThree interface{}) error {
	var db = dbc.DB.Exec(sql, valueOne, valueTwo, valueThree)
	//if db.RowsAffected > 0 {
	clog.Print("sqlop,ExecThreeP,sql=", sql)
	clog.Info("sqlop,ExecThreeP,valueOne=", valueOne)
	clog.Info("sqlop,ExecThreeP,valueTwo=", valueTwo)
	clog.Info("sqlop,ExecThreeP,valueThree=", valueThree)
	clog.Info("sqlop,ExecThreeP,db.RowsAffected=", db.RowsAffected)
	//}
	return db.Error
}

func ExecFourP(sql string, valueOne interface{}, valueTwo interface{}, valueThree interface{}, valueFour interface{}) error {
	var db = dbc.DB.Exec(sql, valueOne, valueTwo, valueThree, valueFour)
	//if db.RowsAffected > 0 {
	clog.Print("sqlop,ExecFourP,sql=", sql)
	clog.Info("sqlop,ExecFourP,valueOne=", valueOne)
	clog.Info("sqlop,ExecFourP,valueTwo=", valueTwo)
	clog.Info("sqlop,ExecFourP,valueThree=", valueThree)
	clog.Info("sqlop,ExecFourP,valueFour=", valueFour)
	clog.Info("sqlop,ExecFourP,db.RowsAffected=", db.RowsAffected)
	//}
	return db.Error
}

func ExecFiveP(sql string, valueOne interface{}, valueTwo interface{}, valueThree interface{}, valueFour interface{}, valueFive interface{}) error {
	var db = dbc.DB.Exec(sql, valueOne, valueTwo, valueThree, valueFour, valueFive)
	//if db.RowsAffected > 0 {
	clog.Print("sqlop,ExecFiveP,sql=", sql)
	clog.Info("sqlop,ExecFiveP,valueOne=", valueOne)
	clog.Info("sqlop,ExecFiveP,valueTwo=", valueTwo)
	clog.Info("sqlop,ExecFiveP,valueThree=", valueThree)
	clog.Info("sqlop,ExecFiveP,valueFour=", valueFour)
	clog.Info("sqlop,ExecFiveP,valueFive=", valueFive)
	clog.Info("sqlop,ExecFiveP,db.RowsAffected=", db.RowsAffected)
	return db.Error
	//}
}

func ExecSixP(sql string, valueOne interface{}, valueTwo interface{}, valueThree interface{}, valueFour interface{}, valueFive interface{}, valueSix interface{}) error {
	var db = dbc.DB.Exec(sql, valueOne, valueTwo, valueThree, valueFour, valueFive, valueSix)
	//if db.RowsAffected > 0 {
	clog.Print("sqlop,ExecSixP,sql=", sql)
	clog.Info("sqlop,ExecSixP,valueOne=", valueOne)
	clog.Info("sqlop,ExecSixP,valueTwo=", valueTwo)
	clog.Info("sqlop,ExecSixP,valueThree=", valueThree)
	clog.Info("sqlop,ExecSixP,valueFour=", valueFour)
	clog.Info("sqlop,ExecSixP,valueFive=", valueFive)
	clog.Info("sqlop,ExecSixP,valueSix=", valueSix)
	clog.Info("sqlop,ExecSixP,db.RowsAffected=", db.RowsAffected)
	return db.Error
	//}
}

func ExecNoP(sql string) {
	var db = dbc.DB.Exec(sql)
	if db.RowsAffected > 0 {
		clog.Print("sqlop,ExecNoP,sql=", sql)
		clog.Info("sqlop,ExecNoP,db.RowsAffected=", db.RowsAffected)
	}
}
